

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=dark>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/icon/dw.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Memory">
  <meta name="keywords" content="">
  
    <meta name="description" content="🍳 PicMemories小程序开发基本流程">
<meta property="og:type" content="article">
<meta property="og:title" content="PicMemories-开发文档">
<meta property="og:url" content="http://example.com/2023/08/02/PicMemories%20%E5%A3%81%E7%BA%B8%E5%88%86%E4%BA%AB%E5%B0%8F%E7%A8%8B%E5%BA%8F%20-%20%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/index.html">
<meta property="og:site_name" content="Memory&#39;s blog">
<meta property="og:description" content="🍳 PicMemories小程序开发基本流程">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://example.com/img/artical/girl14.jpg">
<meta property="article:published_time" content="2023-08-02T08:31:38.000Z">
<meta property="article:modified_time" content="2023-09-08T14:20:22.000Z">
<meta property="article:author" content="Memory">
<meta property="article:tag" content="项目">
<meta property="article:tag" content="开发经验">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://example.com/img/artical/girl14.jpg">
  
  
  
  <title>PicMemories-开发文档 - Memory&#39;s blog</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.4","typing":{"enable":true,"typeSpeed":100,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":false,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  

  

  

  

  

  

  

  



  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 75vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Memory&#39;s blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/">
                <i class="iconfont icon-link-fill"></i>
                <span>友链</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/newBG/girl.jpg') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="PicMemories-开发文档"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        Memory
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-08-02 16:31" pubdate>
          2023年8月2日 下午
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          14k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          36 分钟
        
      </span>
    

    
    
      
        <span id="leancloud-page-views-container" class="post-meta" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="leancloud-page-views"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar category-bar" style="margin-right: -1rem">
    





<div class="category-list">
  
  
    
    
    
    <div class="category row nomargin-x">
      <a class="category-item 
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="项目"
        id="heading-31ecc0e65b4cd3e6b12577382bb56d6a" role="tab" data-toggle="collapse" href="#collapse-31ecc0e65b4cd3e6b12577382bb56d6a"
        aria-expanded="true"
      >
        项目
        <span class="list-group-count">(6)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse show" id="collapse-31ecc0e65b4cd3e6b12577382bb56d6a"
           role="tabpanel" aria-labelledby="heading-31ecc0e65b4cd3e6b12577382bb56d6a">
        
        
          
          
  <div class="category-post-list">
    
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem 
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="开发经验"
        id="heading-bfd19ce0478d81a44ceb5a9a1aa94202" role="tab" data-toggle="collapse" href="#collapse-bfd19ce0478d81a44ceb5a9a1aa94202"
        aria-expanded="true"
      >
        开发经验
        <span class="list-group-count">(5)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse show" id="collapse-bfd19ce0478d81a44ceb5a9a1aa94202"
           role="tabpanel" aria-labelledby="heading-bfd19ce0478d81a44ceb5a9a1aa94202">
        
        
          
          
  <div class="category-post-list">
    
    
      
      
        <a href="/2023/03/17/Memory%20%E7%94%A8%E6%88%B7%E4%B8%AD%E5%BF%83%E7%B3%BB%E7%BB%9F-%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/" title="Memory 用户中心中心-开发文档"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">Memory 用户中心中心-开发文档</span>
        </a>
      
    
      
      
        <a href="/2023/06/20/Typora%E6%93%8D%E4%BD%9C%E6%8A%80%E5%B7%A7/" title="美轮美奂的文档艺术：Typora的使用技巧和实践"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">美轮美奂的文档艺术：Typora的使用技巧和实践</span>
        </a>
      
    
      
      
        <a href="/2023/08/02/PicMemories%20%E5%A3%81%E7%BA%B8%E5%88%86%E4%BA%AB%E5%B0%8F%E7%A8%8B%E5%BA%8F%20-%20%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/" title="PicMemories-开发文档"
           class="list-group-item list-group-item-action
           active">
          <span class="category-post">PicMemories-开发文档</span>
        </a>
      
    
      
      
        <a href="/2023/08/07/TaskMemories%20-%20%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/" title="TaskMemories-开发文档"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">TaskMemories-开发文档</span>
        </a>
      
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="Elasticsearch"
        id="heading-45e23a169652aaf95ce80da844f3df0d" role="tab" data-toggle="collapse" href="#collapse-45e23a169652aaf95ce80da844f3df0d"
        aria-expanded="false"
      >
        Elasticsearch
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-45e23a169652aaf95ce80da844f3df0d"
           role="tabpanel" aria-labelledby="heading-45e23a169652aaf95ce80da844f3df0d">
        
        
          
          
  <div class="category-post-list">
    
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="Logstash"
        id="heading-65859d7d6b0c6a5327b8f0b0c09653ad" role="tab" data-toggle="collapse" href="#collapse-65859d7d6b0c6a5327b8f0b0c09653ad"
        aria-expanded="false"
      >
        Logstash
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-65859d7d6b0c6a5327b8f0b0c09653ad"
           role="tabpanel" aria-labelledby="heading-65859d7d6b0c6a5327b8f0b0c09653ad">
        
        
          
          
  <div class="category-post-list">
    
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="Kibana"
        id="heading-5228fdd6f613af63fc73ee7c02ef8fb5" role="tab" data-toggle="collapse" href="#collapse-5228fdd6f613af63fc73ee7c02ef8fb5"
        aria-expanded="false"
      >
        Kibana
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-5228fdd6f613af63fc73ee7c02ef8fb5"
           role="tabpanel" aria-labelledby="heading-5228fdd6f613af63fc73ee7c02ef8fb5">
        
        
          
  <div class="category-post-list">
    
    
      
      
        <a href="/2023/08/26/MemorySearch%20%E5%BF%86%E6%90%9C%E9%98%81-%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/" title="MemorySearch 忆搜阁-开发文档"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">MemorySearch 忆搜阁-开发文档</span>
        </a>
      
    
  </div>

        
      </div>
    </div>
  
        
      </div>
    </div>
  
        
      </div>
    </div>
  
        
      </div>
    </div>
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="项目部署"
        id="heading-50be5e3b1697e929a38352262896962e" role="tab" data-toggle="collapse" href="#collapse-50be5e3b1697e929a38352262896962e"
        aria-expanded="false"
      >
        项目部署
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-50be5e3b1697e929a38352262896962e"
           role="tabpanel" aria-labelledby="heading-50be5e3b1697e929a38352262896962e">
        
        
          
          
  <div class="category-post-list">
    
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="开发经验"
        id="heading-bfd19ce0478d81a44ceb5a9a1aa94202" role="tab" data-toggle="collapse" href="#collapse-bfd19ce0478d81a44ceb5a9a1aa94202"
        aria-expanded="false"
      >
        开发经验
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-bfd19ce0478d81a44ceb5a9a1aa94202"
           role="tabpanel" aria-labelledby="heading-bfd19ce0478d81a44ceb5a9a1aa94202">
        
        
          
          
  <div class="category-post-list">
    
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="网站"
        id="heading-beb6c0bd8a66cea600c8ce40167eeb57" role="tab" data-toggle="collapse" href="#collapse-beb6c0bd8a66cea600c8ce40167eeb57"
        aria-expanded="false"
      >
        网站
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-beb6c0bd8a66cea600c8ce40167eeb57"
           role="tabpanel" aria-labelledby="heading-beb6c0bd8a66cea600c8ce40167eeb57">
        
        
          
  <div class="category-post-list">
    
    
      
      
        <a href="/2023/06/04/%E6%8F%AD%E7%A7%98%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2%E4%B8%8A%E7%BA%BF%E4%B9%8B%E8%B7%AF%EF%BC%9A%E6%B5%81%E7%A8%8B%E3%80%81%E6%8C%91%E6%88%98%E4%B8%8E%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/" title="揭秘项目部署上线之路：流程、挑战与解决方案"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">揭秘项目部署上线之路：流程、挑战与解决方案</span>
        </a>
      
    
  </div>

        
      </div>
    </div>
  
        
      </div>
    </div>
  
        
      </div>
    </div>
  
        
      </div>
    </div>
  
</div>


  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">PicMemories-开发文档</h1>
            
              <p class="note note-success">
                
                  
                    本文最后更新于：10 个月前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><ul>
<li><h5 id="今天花了两小时时间，快速浏览了小程序官方文档，凭借之前对Vue的使用，小程序开发上手也不难"><a href="#今天花了两小时时间，快速浏览了小程序官方文档，凭借之前对Vue的使用，小程序开发上手也不难" class="headerlink" title="今天花了两小时时间，快速浏览了小程序官方文档，凭借之前对Vue的使用，小程序开发上手也不难"></a>今天花了两小时时间，快速浏览了小程序官方文档，凭借之前对Vue的使用，小程序开发上手也不难</h5></li>
<li><h5 id="就决定开发一个壁纸分享小程序了，8月中旬交付"><a href="#就决定开发一个壁纸分享小程序了，8月中旬交付" class="headerlink" title="就决定开发一个壁纸分享小程序了，8月中旬交付"></a>就决定开发一个壁纸分享小程序了，8月中旬交付</h5></li>
</ul>
<h2 id="布局"><a href="#布局" class="headerlink" title="布局"></a>布局</h2><ul>
<li>首页：展示热门壁纸、推荐壁纸和最新壁纸，可以根据用户的兴趣和喜好个性化推荐。还可以提供搜索入口和分类导航等功能。</li>
<li>壁纸详情页：展示壁纸的详细信息，包括壁纸的名称、作者、标签，以及用户的点赞、收藏和评论等相关操作。</li>
<li>分类浏览页：根据不同的壁纸分类，展示相应的壁纸列表，例如风景、动物、抽象等分类，供用户浏览和选择。</li>
<li>用户个人中心：展示用户的个人信息和上传的壁纸作品，同时也可以查看用户的收藏、点赞、关注等信息。提供账号设置和退出登录等功能。</li>
<li>上传壁纸页：提供用户上传自己创作的壁纸作品的功能，并在上传过程中引导用户填写相关信息。</li>
<li>搜索页：提供关键词搜索功能，让用户可以根据关键词查找特定的壁纸。</li>
<li>社区动态页：展示用户的评论、点赞和关注等动态，以及最新的壁纸上传和更新。</li>
</ul>
<h2 id="功能"><a href="#功能" class="headerlink" title="功能"></a>功能</h2><ul>
<li>用户注册与登录：实现用户注册与登录功能，以便用户上传和下载壁纸。可以使用微信账号登录或自定义的用户名密码登录等方式。</li>
<li>壁纸分类与标签：为壁纸设置分类和标签，方便用户按照不同主题或风格浏览和搜索壁纸，例如自然风景、抽象艺术、爱情等分类。</li>
<li>壁纸上传与审核：允许用户上传自己的壁纸作品，并设置相应的审核机制，以确保壁纸质量和合法性。</li>
<li>壁纸展示与预览：在小程序中以美观的方式展示壁纸，可以支持浏览、收藏和点赞等操作。同时提供高清壁纸的预览功能，让用户可以在下载之前先查看壁纸效果。</li>
<li>壁纸下载与分享：提供壁纸的下载功能，让用户可以保存到手机或设备中。同时，也可以支持壁纸的分享功能，让用户可以将喜欢的壁纸分享给好友或社交网络。</li>
<li>用户互动与社区：构建一个用户互动的社区，让用户可以在小程序中进行评论、点赞、关注等操作，增加用户的参与感和粘性。</li>
<li>推荐与排行榜：实现壁纸的推荐算法或根据用户的喜好进行个性化推荐，同时也可以设置一些壁纸的热门排行榜，展示最受欢迎的壁纸作品。</li>
</ul>
<h2 id="技术栈"><a href="#技术栈" class="headerlink" title="技术栈"></a>技术栈</h2><h3 id="前端开发："><a href="#前端开发：" class="headerlink" title="前端开发："></a>前端开发：</h3><ul>
<li>微信小程序开发工具：使用微信小程序开发工具进行前端页面的开发和调试。</li>
<li>HTML5、CSS3、JavaScript：这些是前端开发的基本技术，用于构建小程序的页面和交互。</li>
<li>微信小程序框架：根据个人喜好和熟悉程度选择使用原生小程序框架或者类似Vue.js的框架（如MpVue或WePY）。</li>
</ul>
<h3 id="后端开发："><a href="#后端开发：" class="headerlink" title="后端开发："></a>后端开发：</h3><ul>
<li>Java语言：使用Java语言进行后端开发，可以使用Java的Spring Boot框架来简化开发。</li>
<li>Spring Boot：使用Spring Boot框架可以快速搭建后端服务，包括路由、控制器、数据持久化等功能。</li>
<li>MySQL数据库：使用MySQL作为数据存储和管理系统，存储用户信息、壁纸数据等。</li>
<li>Redis缓存：使用Redis作为缓存，提高数据访问的性能和响应速度。</li>
<li>Mybatis：使用Mybatis框架来简化数据库操作和管理。</li>
<li>MybatisPlus：Mybatis的增强工具，可以进一步简化开发并提供一些便捷的功能。</li>
</ul>
<h3 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h3><ul>
<li>图片存储和管理：可以使用七牛云、阿里云OSS等云存储服务，将上传的壁纸保存到云端。</li>
<li>RESTful API设计：使用RESTful API来设计前后端之间的数据交互接口，方便前后端的协作开发。</li>
<li>微信开放平台接口：如果需要实现一些与微信相关的功能，可探索并使用微信开放平台提供的接口和功能。</li>
</ul>
<h1 id="正文"><a href="#正文" class="headerlink" title="正文"></a>正文</h1><h2 id="设计数据库表"><a href="#设计数据库表" class="headerlink" title="设计数据库表"></a>设计数据库表</h2><ul>
<li><h5 id="以下是本壁纸分享小程序-PicMemorie-一些可能用到的数据库表的设计："><a href="#以下是本壁纸分享小程序-PicMemorie-一些可能用到的数据库表的设计：" class="headerlink" title="以下是本壁纸分享小程序 PicMemorie 一些可能用到的数据库表的设计："></a>以下是本壁纸分享小程序 PicMemorie 一些可能用到的数据库表的设计：</h5></li>
</ul>
<ol>
<li><h5 id="用户表（User）"><a href="#用户表（User）" class="headerlink" title="用户表（User）"></a>用户表（User）</h5><ul>
<li>用户ID（UserID）</li>
<li>用户名（Username）</li>
<li>密码（Password）</li>
<li>头像（Avatar）</li>
<li>注册日期（RegistrationDate）</li>
<li>其他用户相关信息</li>
</ul>
</li>
<li><h5 id="壁纸表（Wallpaper）"><a href="#壁纸表（Wallpaper）" class="headerlink" title="壁纸表（Wallpaper）"></a>壁纸表（Wallpaper）</h5><ul>
<li>壁纸ID（WallpaperID）</li>
<li>壁纸名称（WallpaperName）</li>
<li>壁纸描述（WallpaperDescription）</li>
<li>壁纸URL（WallpaperURL）</li>
<li>上传日期（UploadDate）</li>
<li>点赞数（Likes）</li>
<li>下载数（Downloads）</li>
<li>所属用户ID（UserID）</li>
<li>其他壁纸相关信息</li>
</ul>
</li>
<li><h5 id="点赞表（Like）"><a href="#点赞表（Like）" class="headerlink" title="点赞表（Like）"></a>点赞表（Like）</h5><ul>
<li>点赞ID（LikeID）</li>
<li>点赞用户ID（UserID）</li>
<li>被点赞的壁纸ID（WallpaperID）</li>
<li>点赞时间（LikeDate）</li>
</ul>
</li>
<li><h5 id="下载表（Download）"><a href="#下载表（Download）" class="headerlink" title="下载表（Download）"></a>下载表（Download）</h5><ul>
<li>下载ID（DownloadID）</li>
<li>下载用户ID（UserID）</li>
<li>被下载的壁纸ID（WallpaperID）</li>
<li>下载时间（DownloadDate）</li>
</ul>
</li>
</ol>
<h2 id="建表语句"><a href="#建表语句" class="headerlink" title="建表语句"></a>建表语句</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs sql">use pic_memories;<br><span class="hljs-comment">-- 用户信息</span><br><span class="hljs-keyword">drop</span> <span class="hljs-keyword">table</span> if <span class="hljs-keyword">exists</span> pic_memories.user;<br><span class="hljs-keyword">create</span> <span class="hljs-keyword">table</span> if <span class="hljs-keyword">not</span> <span class="hljs-keyword">exists</span> pic_memories.`<span class="hljs-keyword">user</span>`<br>(<br>    `user_id`   <span class="hljs-type">bigint</span> auto_increment <span class="hljs-keyword">primary</span> key comment <span class="hljs-string">&#x27;用户id&#x27;</span>,<br>    `username`  <span class="hljs-type">varchar</span>(<span class="hljs-number">128</span>)                         <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;用户名&#x27;</span>,<br>    `password`  <span class="hljs-type">varchar</span>(<span class="hljs-number">32</span>)                          <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;用户名&#x27;</span>,<br>    `avatar`    <span class="hljs-type">varchar</span>(<span class="hljs-number">256</span>)                         <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;头像&#x27;</span>,<br>    phone       <span class="hljs-type">varchar</span>(<span class="hljs-number">16</span>)                          <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;电话&#x27;</span>,<br>    user_role   tinyint(<span class="hljs-number">1</span>) <span class="hljs-keyword">default</span> <span class="hljs-number">0</span>                 <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;普通用户-0 管理员-1---&#x27;</span>,<br>    createTime  datetime   <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;创建时间&#x27;</span>,<br>    updateTime  datetime   <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;更新时间&#x27;</span>,<br>    `is_delete` tinyint(<span class="hljs-number">1</span>) <span class="hljs-keyword">default</span> <span class="hljs-number">0</span>                 <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;是否删除&#x27;</span><br>) comment <span class="hljs-string">&#x27;用户信息&#x27;</span>;<br></code></pre></td></tr></table></figure>

<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-comment">-- 壁纸信息</span><br><span class="hljs-keyword">drop</span> <span class="hljs-keyword">table</span> if <span class="hljs-keyword">exists</span> pic_memories.wallpaper;<br><span class="hljs-keyword">create</span> <span class="hljs-keyword">table</span> if <span class="hljs-keyword">not</span> <span class="hljs-keyword">exists</span> `wallpaper`<br>(<br>    `wallpaper_id`          <span class="hljs-type">bigint</span> auto_increment <span class="hljs-keyword">primary</span> key comment <span class="hljs-string">&#x27;壁纸id&#x27;</span>,<br>    `wallpaper_name`        <span class="hljs-type">varchar</span>(<span class="hljs-number">256</span>)                         <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;壁纸名&#x27;</span>,<br>    `wallpaper_description` <span class="hljs-type">varchar</span>(<span class="hljs-number">256</span>)                         <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;壁纸描述&#x27;</span>,<br>    `wallpaper_url`         <span class="hljs-type">varchar</span>(<span class="hljs-number">256</span>)                         <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;壁纸URL&#x27;</span>,<br>    `upload_date`           datetime                             <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;上传日期&#x27;</span>,<br>    `likes`                 <span class="hljs-type">int</span>                                  <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞数&#x27;</span>,<br>    `downloads`             <span class="hljs-type">int</span>                                  <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;用户名&#x27;</span>,<br>    `user_id`               <span class="hljs-type">bigint</span>                               <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;所属用户&#x27;</span>,<br>    status                  tinyint(<span class="hljs-number">1</span>)                           <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> <span class="hljs-keyword">default</span> <span class="hljs-number">1</span> comment <span class="hljs-string">&#x27;1 - 审核中 2 - 已发布 3 - 未通过&#x27;</span>,<br>    `create_time`           datetime   <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;创建时间&#x27;</span>,<br>    `update_time`           datetime   <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;更新时间&#x27;</span>,<br>    `is_delete`             tinyint(<span class="hljs-number">1</span>) <span class="hljs-keyword">default</span> <span class="hljs-number">0</span>                 <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;是否删除&#x27;</span><br>) comment <span class="hljs-string">&#x27;壁纸信息&#x27;</span>;<br></code></pre></td></tr></table></figure>

<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-comment">-- 点赞信息</span><br><span class="hljs-keyword">create</span> <span class="hljs-keyword">table</span> if <span class="hljs-keyword">not</span> <span class="hljs-keyword">exists</span> pic_memories.`<span class="hljs-keyword">like</span>`<br>(<br>    `like_id` <span class="hljs-type">bigint</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞id&#x27;</span>,<br>    `user_id` <span class="hljs-type">bigint</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞用户id&#x27;</span>,<br>    `wallpaper_id` <span class="hljs-type">bigint</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;被点赞的壁纸id&#x27;</span>,<br>    `like_date` datetime <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞时间&#x27;</span>,<br>    `create_time` datetime <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;创建时间&#x27;</span>,<br>    `update_time` datetime <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;更新时间&#x27;</span>,<br>    `is_delete` <span class="hljs-type">varchar</span>(<span class="hljs-number">256</span>) <span class="hljs-keyword">default</span> <span class="hljs-string">&#x27;0&#x27;</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;是否删除&#x27;</span><br>    ) comment <span class="hljs-string">&#x27;点赞信息&#x27;</span>;<br></code></pre></td></tr></table></figure>

<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-comment">-- 下载信息</span><br><span class="hljs-keyword">create</span> <span class="hljs-keyword">table</span> if <span class="hljs-keyword">not</span> <span class="hljs-keyword">exists</span> pic_memories.`download`<br>(<br>    `download_id` <span class="hljs-type">bigint</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞id&#x27;</span>,<br>    `user_id` <span class="hljs-type">bigint</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞用户id&#x27;</span>,<br>    `wallpaper_id` <span class="hljs-type">bigint</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;被点赞的壁纸id&#x27;</span>,<br>    `like_date` datetime <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;点赞时间&#x27;</span>,<br>    `create_time` datetime <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;创建时间&#x27;</span>,<br>    `update_time` datetime <span class="hljs-keyword">default</span> <span class="hljs-built_in">CURRENT_TIMESTAMP</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;更新时间&#x27;</span>,<br>    `is_delete` <span class="hljs-type">varchar</span>(<span class="hljs-number">256</span>) <span class="hljs-keyword">default</span> <span class="hljs-string">&#x27;0&#x27;</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">null</span> comment <span class="hljs-string">&#x27;是否删除&#x27;</span><br>    ) comment <span class="hljs-string">&#x27;下载信息&#x27;</span>;<br></code></pre></td></tr></table></figure>

<ul>
<li><a target="_blank" rel="noopener" href="http://ry2s7czdf.hd-bkt.clouddn.com/imgs/avatar/winter_nature_6-wallpaper-2560x1600.jpg">http://ry2s7czdf.hd-bkt.clouddn.com/imgs/avatar/winter_nature_6-wallpaper-2560x1600.jpg</a></li>
</ul>
<ul>
<li></li>
</ul>
<h2 id="用户登录-注册"><a href="#用户登录-注册" class="headerlink" title="用户登录/注册"></a>用户登录/注册</h2><h2 id="页面导航栏"><a href="#页面导航栏" class="headerlink" title="页面导航栏"></a>页面导航栏</h2><ul>
<li>暂定为四栏：<ul>
<li>精选碓 ✔</li>
<li>分类 ✔</li>
<li>动态/频道 ✔</li>
<li>我的 ✔</li>
</ul>
</li>
<li>具体页面：<ul>
<li>精选页：精选壁纸：点赞量高、下载量高、最新上传</li>
<li>分类页：根据分类，展示壁纸</li>
<li>动态/频道：交互事件：壁纸上传、用户交流</li>
<li>我的：<ul>
<li>用户信息详情页：完善资料、我的收藏、我的下载、上传壁纸、关于我们，✔</li>
<li>其他：原创专栏 ✔</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="壁纸展示"><a href="#壁纸展示" class="headerlink" title="壁纸展示"></a>壁纸展示</h2><ul>
<li>仅展示通过审核的壁纸：2 - 已发布</li>
</ul>
<h2 id="壁纸上传"><a href="#壁纸上传" class="headerlink" title="壁纸上传"></a>壁纸上传</h2><ul>
<li><p>普通用户可以上传壁纸，状态默认为：1 - 审核中，交由管理员审核</p>
</li>
<li><p>管理员决定图片是否可以上传</p>
<ul>
<li>上传成功，状态修改为：2 - 已发布</li>
<li>不通过，则状态修改为：3 - 未通过</li>
</ul>
</li>
<li><p>通过的图片即可放入云对象存储中，持久化存储</p>
</li>
</ul>
<h2 id="今日目标"><a href="#今日目标" class="headerlink" title="今日目标"></a>今日目标</h2><ul>
<li>精选页，页面开发 ✔</li>
<li>用户页，页面开发 ✔</li>
<li>用户登录、注册 ✔</li>
<li>登录用户信息</li>
</ul>
<h2 id="用户注册-登录"><a href="#用户注册-登录" class="headerlink" title="用户注册/登录"></a>用户注册/登录</h2><ul>
<li>昵称、密码、手机号 ✔</li>
<li>长度校验（前台 + 后台） ✔</li>
<li>昵称不能携带特殊符号 ✔</li>
<li>密码只能字母+数字 ✔</li>
<li>手机号只能为大陆手机号，符合要求 ✔</li>
<li>用户校验和数据状态保存 ✔</li>
</ul>
<h2 id="图片展示"><a href="#图片展示" class="headerlink" title="图片展示"></a>图片展示</h2><ul>
<li><p>分类展示：壁纸的所属分类+已通过审核 ✔</p>
</li>
<li><p>最新：上传时间倒序 ✔</p>
</li>
</ul>
<h2 id="管理员后台"><a href="#管理员后台" class="headerlink" title="管理员后台"></a>管理员后台</h2><ul>
<li>管理壁纸信息<ul>
<li>壁纸基本信息：壁纸名、描述、图片、所属分类、上传者、上传时间、更新时间、状态（审核中 已通过 未通过）</li>
<li>其他：点赞数、下载量 ✔</li>
</ul>
</li>
<li>管理用户信息<ul>
<li>用户的基本信息 ✔</li>
</ul>
</li>
<li>管理用户的上传需求：审核表</li>
<li>壁纸审核：<ul>
<li>管理壁纸的上传、下架</li>
<li>小程序实现上传壁纸</li>
<li>用户上传，保存至审核表；</li>
<li>管理员审核，审核通过，存储至七牛云，返回链接；</li>
<li>存储至壁纸信息表</li>
</ul>
</li>
</ul>
<h2 id="用户使用"><a href="#用户使用" class="headerlink" title="用户使用"></a>用户使用</h2><ul>
<li><p>壁纸搜索</p>
<ul>
<li>根据类型搜索</li>
<li>在类型下，可选择按点赞量、上传时间排序</li>
</ul>
</li>
<li><p>频道</p>
<ul>
<li>频道同步显示上传信息</li>
</ul>
</li>
<li><p>壁纸信息</p>
<ul>
<li>点击壁纸，预览查看壁纸 ✔</li>
<li>可点赞 ✔</li>
<li>可下载</li>
<li>小程序实现下载壁纸</li>
</ul>
</li>
<li><p>我的</p>
<ul>
<li>查看个人信息  ✔</li>
<li>修改个人信息：展示数据、点击显示、修改提交、再次显示   ✔</li>
<li>点赞过的壁纸</li>
<li>下载的壁纸？（这个得看壁纸下载到哪儿了）</li>
<li>信息修改 ✔</li>
</ul>
</li>
<li><p>分类搜索壁纸</p>
<ul>
<li>壁纸分类：自然风景、动漫插画、动物世界、游戏竞技、星空宇宙、美食餐饮、 唯美治愈、影音视听、城市建筑、音乐艺术、历史文化、girl ✔</li>
<li>分类查询</li>
</ul>
</li>
<li><p>壁纸下载</p>
<ul>
<li>点击壁纸，跳转新页面 ✔</li>
<li>壁纸信息预览、上传人信息 ✔</li>
<li>支持下载，图片保存至用户相册：wx.saveImageToPhotosAlbum</li>
</ul>
</li>
<li><p>壁纸上传</p>
<ul>
<li> “van-uploader”: “@vant/weapp/uploader/index”，文件上传</li>
</ul>
</li>
<li><p>退出登录  ✔</p>
</li>
</ul>
<h2 id="小小优化"><a href="#小小优化" class="headerlink" title="小小优化"></a>小小优化</h2><ul>
<li>未登录用户不支持完善个人资料</li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-comment">// 跳转个人信息页</span><br> <span class="hljs-title function_">toUserInfo</span>(<span class="hljs-params"></span>) &#123;<br>   <span class="hljs-keyword">if</span>(!<span class="hljs-variable language_">this</span>.<span class="hljs-property">data</span>.<span class="hljs-property">currentUser</span> == &#123;&#125;)&#123;<br>     wx.<span class="hljs-title function_">navigateTo</span>(&#123;<br>       <span class="hljs-attr">url</span>: <span class="hljs-string">&#x27;/pages/userInfo/index&#x27;</span>,<br>     &#125;)<br>   &#125;<span class="hljs-keyword">else</span>&#123;<br>     <span class="hljs-title class_">Toast</span>(<span class="hljs-string">&quot;请先登录~&quot;</span>)<br>   &#125;<br> &#125;,<br></code></pre></td></tr></table></figure>

<h2 id="接口实现"><a href="#接口实现" class="headerlink" title="接口实现"></a>接口实现</h2><ul>
<li><p>用户登录 ✔</p>
</li>
<li><p>用户注册 ✔</p>
</li>
<li><p>保存用户登录态 ✔</p>
</li>
<li><p>展示登录用户信息 ✔</p>
</li>
<li><p>用户修改信息</p>
</li>
<li><p>壁纸：分类、分页获取（已通过）✔</p>
</li>
<li><p>点击查看壁纸详细信息：点赞数、收藏量，可提供下载</p>
</li>
<li><p>用户下载壁纸 - 下载表（用户id、）</p>
</li>
<li><p>用户上传壁纸 - 上传表（）</p>
</li>
</ul>
<h2 id="数据库表修改"><a href="#数据库表修改" class="headerlink" title="数据库表修改"></a>数据库表修改</h2><ul>
<li><h5 id="需新增用户上传表（2023-08-06午）"><a href="#需新增用户上传表（2023-08-06午）" class="headerlink" title="需新增用户上传表（2023/08/06午）"></a>需新增用户上传表（2023/08/06午）</h5></li>
<li><p>用户与壁纸交互：浏览壁纸、点赞壁纸、下载壁纸、上传壁纸</p>
</li>
<li><p>不需要记录壁纸下载表</p>
</li>
</ul>
<h2 id="小程序登录-用户身份标识"><a href="#小程序登录-用户身份标识" class="headerlink" title="小程序登录 - 用户身份标识"></a>小程序登录 - 用户身份标识</h2><ul>
<li><h5 id="这里讲一下在微信小程序开发过程中，如何做到记录用户登录态，标识用户身份（2023-08-06早）"><a href="#这里讲一下在微信小程序开发过程中，如何做到记录用户登录态，标识用户身份（2023-08-06早）" class="headerlink" title="这里讲一下在微信小程序开发过程中，如何做到记录用户登录态，标识用户身份（2023/08/06早）"></a>这里讲一下在微信小程序开发过程中，如何做到记录用户登录态，标识用户身份（2023/08/06早）</h5></li>
<li><p><a target="_blank" rel="noopener" href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-login/code2Session.html">小程序登录 / 小程序登录 | 小程序登录 | 微信开放文档 (qq.com)</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/login.html">开放能力 / 用户信息 / 小程序登录 | 小程序登录 | 微信开放文档 (qq.com)</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://www.hutool.cn/docs/#/http/Http%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%B7%A5%E5%85%B7%E7%B1%BB-HttpUtil">Http客户端工具类-HttpUtil (hutool.cn)</a></p>
</li>
<li><h5 id="整个流程如下："><a href="#整个流程如下：" class="headerlink" title="整个流程如下："></a>整个流程如下：</h5><ul>
<li><p>前台获取临时登录凭证code ✔</p>
</li>
<li><p>发送code到服务端 ✔</p>
</li>
<li><p>服务端拿到code，通过code调用Code3Session接口，获取openid、session_key ✔</p>
</li>
<li><p>服务端返回openid、session_key到前台 ✔</p>
</li>
<li><p>前台拿到openid、session_key，作为token ✔</p>
</li>
<li><p>之后，前台发送请求，携带token ✔</p>
</li>
<li><h5 id="服务器通过校验token，选择是否响应该请求（2023-08-06午）"><a href="#服务器通过校验token，选择是否响应该请求（2023-08-06午）" class="headerlink" title="服务器通过校验token，选择是否响应该请求（2023/08/06午）"></a>服务器通过校验token，选择是否响应该请求（2023/08/06午）</h5></li>
</ul>
</li>
<li><h5 id="好久没优化了，截下成果图吧：（2023-09-08晚）"><a href="#好久没优化了，截下成果图吧：（2023-09-08晚）" class="headerlink" title="好久没优化了，截下成果图吧：（2023/09/08晚）"></a>好久没优化了，截下成果图吧：（2023/09/08晚）</h5></li>
</ul>
<p><img src="https://gitee.com/deng-2022/pictures/raw/master/images/image-20230908221852633.png" alt="image-20230908221852633"></p>
<p><img src="https://gitee.com/deng-2022/pictures/raw/master/images/image-20230908221858146.png" alt="image-20230908221858146"></p>
<p><img src="https://gitee.com/deng-2022/pictures/raw/master/images/image-20230908221905369.png" alt="image-20230908221905369"></p>
<h2 id="壁纸状态"><a href="#壁纸状态" class="headerlink" title="壁纸状态"></a>壁纸状态</h2><ul>
<li><h5 id="壁纸状态：（2023-08-06午）"><a href="#壁纸状态：（2023-08-06午）" class="headerlink" title="壁纸状态：（2023/08/06午）"></a>壁纸状态：（2023/08/06午）</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 0 - 公开, 在队伍大厅中可以直接加入</span><br><span class="hljs-comment"> */</span><br>REVIEW(<span class="hljs-number">0</span>, <span class="hljs-string">&quot;审核中&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 1 - 私有, 在队伍大厅中不可以直接加入</span><br><span class="hljs-comment"> */</span><br>PASS(<span class="hljs-number">1</span>, <span class="hljs-string">&quot;已发布&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 2 - 公开且加密, 加入队伍需要密码</span><br><span class="hljs-comment"> */</span><br>NOPASS(<span class="hljs-number">2</span>, <span class="hljs-string">&quot;不通过&quot;</span>);<br></code></pre></td></tr></table></figure>

<h2 id="壁纸分类"><a href="#壁纸分类" class="headerlink" title="壁纸分类"></a>壁纸分类</h2><ul>
<li><h5 id="壁纸分类：（2023-08-06午）"><a href="#壁纸分类：（2023-08-06午）" class="headerlink" title="壁纸分类：（2023/08/06午）"></a>壁纸分类：（2023/08/06午）</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 0 - 自然风景</span><br><span class="hljs-comment"> */</span><br>NATURAL(<span class="hljs-number">0</span>, <span class="hljs-string">&quot;自然风景&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 1 - 动漫插画</span><br><span class="hljs-comment"> */</span><br>CARTOON(<span class="hljs-number">1</span>, <span class="hljs-string">&quot;动漫插画&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 2 - 未来科技</span><br><span class="hljs-comment"> */</span><br>TECHNOLOGY(<span class="hljs-number">2</span>, <span class="hljs-string">&quot;未来科技&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 3 - girl</span><br><span class="hljs-comment"> */</span><br>GIRL(<span class="hljs-number">2</span>, <span class="hljs-string">&quot;girl&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 4 - 游戏</span><br><span class="hljs-comment"> */</span><br>GAME(<span class="hljs-number">2</span>, <span class="hljs-string">&quot;游戏&quot;</span>),<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 5 - 美食</span><br><span class="hljs-comment"> */</span><br>FOOD(<span class="hljs-number">2</span>, <span class="hljs-string">&quot;美食&quot;</span>);<br></code></pre></td></tr></table></figure>

<h2 id="分类查询壁纸"><a href="#分类查询壁纸" class="headerlink" title="分类查询壁纸"></a>分类查询壁纸</h2><ul>
<li><p>查询所有分类</p>
</li>
<li><p>按分类，依次查询每个分类下的壁纸</p>
</li>
<li><p>前台传送参数，查询那个分类下的壁纸</p>
</li>
<li><p>controller：</p>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@GetMapping(&quot;/listPage&quot;)</span><br>  <span class="hljs-keyword">public</span> BaseResponse&lt;List&lt;Wallpaper&gt;&gt; <span class="hljs-title function_">getPageByType</span><span class="hljs-params">(<span class="hljs-meta">@RequestParam</span> Integer searchType)</span> &#123;<br>      <span class="hljs-comment">//controller对参数的校验</span><br>      <span class="hljs-keyword">if</span> (searchType == <span class="hljs-literal">null</span>) &#123;<br>          <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(PARMS_ERROR, <span class="hljs-string">&quot;请求参数错误&quot;</span>);<br>      &#125;<br><br>      List&lt;Wallpaper&gt; result = wallpaperService.getPageByType(searchType);<br>      <span class="hljs-keyword">return</span> ResultUtils.success(result);<br>  &#125;<br></code></pre></td></tr></table></figure>

<ul>
<li>service：</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">   * 分页查询</span><br><span class="hljs-comment">   * 分类查询壁纸</span><br><span class="hljs-comment">   *</span><br><span class="hljs-comment">   * <span class="hljs-doctag">@return</span> 分类壁纸</span><br><span class="hljs-comment">   */</span><br>  <span class="hljs-meta">@Override</span><br>  <span class="hljs-keyword">public</span> List&lt;Wallpaper&gt; <span class="hljs-title function_">getPageByType</span><span class="hljs-params">(Integer searchType)</span> &#123;<br>      <span class="hljs-keyword">if</span> (WallpaperTypeEnum.getEnumByValue(searchType) == <span class="hljs-literal">null</span>) &#123;<br>          <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(ErrorCode.PARMS_ERROR, <span class="hljs-string">&quot;没有这样的壁纸类型&quot;</span>);<br>      &#125;<br><br>      QueryWrapper&lt;Wallpaper&gt; type_wqw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>      type_wqw.eq(<span class="hljs-string">&quot;type&quot;</span>, searchType);<br><br>      <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.list(type_wqw);<br>  &#125;<br></code></pre></td></tr></table></figure>

<ul>
<li><h5 id="我这代码写得真烂，逻辑混乱："><a href="#我这代码写得真烂，逻辑混乱：" class="headerlink" title="我这代码写得真烂，逻辑混乱："></a>我这代码写得真烂，逻辑混乱：</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">    * 分页查询</span><br><span class="hljs-comment">    * 分类查询壁纸</span><br><span class="hljs-comment">    *</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@return</span></span><br><span class="hljs-comment">    */</span><br>   <span class="hljs-meta">@Override</span><br>   <span class="hljs-keyword">public</span> List&lt;Wallpaper&gt; <span class="hljs-title function_">getPageByType</span><span class="hljs-params">(Integer searchType)</span> &#123;<br>       <span class="hljs-comment">// 1.查询所有分类</span><br>       QueryWrapper&lt;Wallpaper&gt; wqw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>       wqw.select(<span class="hljs-string">&quot;type&quot;</span>);<br>       wqw.eq(<span class="hljs-string">&quot;status&quot;</span>, WallpaperStatusEnum.PASS.getValue());<br>       wqw.groupBy(<span class="hljs-string">&quot;type&quot;</span>);<br>       List&lt;Wallpaper&gt; list = wallpaperService.list(wqw);<br>       <span class="hljs-comment">// 2.存储所有分类</span><br>       ArrayList&lt;Integer&gt; tyeList = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;&gt;();<br>       <span class="hljs-keyword">for</span> (Wallpaper wallpaper : list) &#123;<br>           <span class="hljs-type">Integer</span> <span class="hljs-variable">type</span> <span class="hljs-operator">=</span> wallpaper.getType();<br>           tyeList.add(type);<br>       &#125;<br>       <span class="hljs-comment">// 3.按分类查询, 返回壁纸列表</span><br>       List&lt;Wallpaper&gt; wallpaperListByType = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;&gt;();<br>       <span class="hljs-comment">// 校验壁纸类型</span><br>       <span class="hljs-keyword">for</span> (Integer type : tyeList) &#123;<br>           <span class="hljs-keyword">if</span> (WallpaperTypeEnum.getEnumByValue(searchType) == <span class="hljs-literal">null</span>) &#123;<br>               <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(ErrorCode.PARMS_ERROR, <span class="hljs-string">&quot;没有这样的壁纸类型&quot;</span>);<br>           &#125;<br>           <br>           QueryWrapper&lt;Wallpaper&gt; type_wqw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>           type_wqw.eq(<span class="hljs-string">&quot;type&quot;</span>, type);<br><br>           wallpaperListByType = wallpaperService.list(type_wqw);<br>       &#125;<br>       <span class="hljs-keyword">return</span> wallpaperListByType;<br>   &#125;<br></code></pre></td></tr></table></figure>

<h2 id="最新查询"><a href="#最新查询" class="headerlink" title="最新查询"></a>最新查询</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">     * 分页查询</span><br><span class="hljs-comment">     * 分类最新壁纸</span><br><span class="hljs-comment">     *</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@return</span> 分类壁纸</span><br><span class="hljs-comment">     */</span><br>    <span class="hljs-meta">@Override</span><br>    <span class="hljs-keyword">public</span> List&lt;Wallpaper&gt; <span class="hljs-title function_">getPageByTime</span><span class="hljs-params">()</span> &#123;<br>        QueryWrapper&lt;Wallpaper&gt; time_wqw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>        time_wqw.orderByAsc(<span class="hljs-string">&quot;create_time&quot;</span>);<br><br>        <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.list(time_wqw);<br>    &#125;<br></code></pre></td></tr></table></figure>

<h2 id="精选查询"><a href="#精选查询" class="headerlink" title="精选查询"></a>精选查询</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">    * 分页查询</span><br><span class="hljs-comment">    * 查询精选壁纸</span><br><span class="hljs-comment">    *</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@return</span> 分类壁纸</span><br><span class="hljs-comment">    */</span><br>   <span class="hljs-meta">@Override</span><br>   <span class="hljs-keyword">public</span> List&lt;Wallpaper&gt; <span class="hljs-title function_">getPageByLike</span><span class="hljs-params">()</span> &#123;<br>       QueryWrapper&lt;Wallpaper&gt; like_wqw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>       like_wqw.orderByDesc(<span class="hljs-string">&quot;likes&quot;</span>);<br><br>       <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.list(like_wqw);<br>   &#125;<br></code></pre></td></tr></table></figure>

<ul>
<li><p>Redis + wx.login + Code2Session ，Session_key</p>
</li>
<li><h5 id="成功实现用户校验，保存用户登录态（2023-08-07早）"><a href="#成功实现用户校验，保存用户登录态（2023-08-07早）" class="headerlink" title="成功实现用户校验，保存用户登录态（2023/08/07早）"></a>成功实现用户校验，保存用户登录态（2023/08/07早）</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">    * 用户注册</span><br><span class="hljs-comment">    *</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> username 昵称</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> password 密码</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> phone    手机号</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@return</span> 用户id</span><br><span class="hljs-comment">    */</span><br>   <span class="hljs-meta">@Override</span><br>   <span class="hljs-keyword">public</span> <span class="hljs-type">long</span> <span class="hljs-title function_">userRegister</span><span class="hljs-params">(String username, String password, String phone)</span> &#123;<br>       <span class="hljs-comment">// 1.校验</span><br>       <span class="hljs-comment">// 1.1.昵称, 密码, 手机号不能为空</span><br>       <span class="hljs-keyword">if</span> (StringUtils.isAnyBlank(username, password, phone)) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(PARMS_ERROR);<br><br>       <span class="hljs-comment">// 1.2.昵称不小于2位, 不大于10位</span><br>       <span class="hljs-keyword">if</span> (username.length() &lt; <span class="hljs-number">2</span> || username.length() &gt; <span class="hljs-number">10</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;昵称不符合要求&quot;</span>, <span class="hljs-number">50000</span>, <span class="hljs-string">&quot;昵称长度不符合要求&quot;</span>);<br><br>       <span class="hljs-comment">// 1.3.昵称不包含特殊字符</span><br>       <span class="hljs-type">String</span> <span class="hljs-variable">pattern</span> <span class="hljs-operator">=</span> <span class="hljs-string">&quot;^[\\u4e00-\\u9fa5A-Za-z\\d_]+$&quot;</span>;<br>       <span class="hljs-keyword">if</span> (!Pattern.matches(pattern, username)) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;昵称不符合要求&quot;</span>, <span class="hljs-number">50001</span>, <span class="hljs-string">&quot;昵称包含特殊字符&quot;</span>);<br><br>       <span class="hljs-comment">// 1.4.密码不小于6位, 不大于10位</span><br>       <span class="hljs-keyword">if</span> (password.length() &lt; <span class="hljs-number">6</span> || password.length() &gt; <span class="hljs-number">10</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;密码不符合要求&quot;</span>, <span class="hljs-number">60000</span>, <span class="hljs-string">&quot;密码长度不符合要求&quot;</span>);<br><br>       <span class="hljs-comment">// 1.5.手机号只能为大陆手机号，符合要求</span><br>       pattern = <span class="hljs-string">&quot;^(13\\d|14[5|7]|15[0|123456789]|18[0|12356789])\\d&#123;8&#125;$&quot;</span>;<br>       <span class="hljs-keyword">if</span> (!Pattern.matches(pattern, phone)) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;手机号不符合要求&quot;</span>, <span class="hljs-number">50001</span>, <span class="hljs-string">&quot;手机号格式有误&quot;</span>);<br><br>       <span class="hljs-comment">// 1.6.昵称不能重复</span><br>       QueryWrapper&lt;User&gt; uqw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>       uqw.eq(<span class="hljs-string">&quot;username&quot;</span>, username);<br>       <span class="hljs-type">Long</span> <span class="hljs-variable">count</span> <span class="hljs-operator">=</span> userMapper.selectCount(uqw);<br>       <span class="hljs-keyword">if</span> (count &gt; <span class="hljs-number">0</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;昵称不符合要求&quot;</span>, <span class="hljs-number">50002</span>, <span class="hljs-string">&quot;该昵称已存在&quot;</span>);<br><br>       <span class="hljs-comment">// 2.对密码进行加密</span><br>       <span class="hljs-type">String</span> <span class="hljs-variable">encryptPassword</span> <span class="hljs-operator">=</span> DigestUtils.md5DigestAsHex((SALT + password).getBytes());<br><br>       <span class="hljs-comment">// 3.向数据库中插入用户数据</span><br>       <span class="hljs-type">User</span> <span class="hljs-variable">user</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">User</span>();<br>       user.setUsername(username);<br>       user.setPassword(encryptPassword);<br>       user.setPhone(phone);<br>       user.setAvatar(<span class="hljs-string">&quot;http://ry2s7czdf.hd-bkt.clouddn.com/imgs/avatar/winter_nature_6-wallpaper-2560x1600.jpg&quot;</span>);<br><br>       <span class="hljs-type">boolean</span> <span class="hljs-variable">save</span> <span class="hljs-operator">=</span> <span class="hljs-built_in">this</span>.save(user);<br>       <span class="hljs-comment">//插入失败</span><br>       <span class="hljs-keyword">if</span> (!save) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(UPDATE_ERROR);<br><br>       <span class="hljs-keyword">return</span> user.getUserId();<br>   &#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">     * 用户登录</span><br><span class="hljs-comment">     *</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> username 昵称</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> password 密码</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> request  登录用户信息</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@return</span> 脱敏用户信息</span><br><span class="hljs-comment">     */</span><br>    <span class="hljs-meta">@Override</span><br>    <span class="hljs-keyword">public</span> User <span class="hljs-title function_">userLogin</span><span class="hljs-params">(String code, String username, String password, HttpServletRequest request)</span> &#123;<br>        <span class="hljs-comment">// 1.校验</span><br>        <span class="hljs-comment">// 1.1.昵称, 密码不能为空</span><br>        <span class="hljs-keyword">if</span> (StringUtils.isAnyBlank(username, password)) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(PARMS_ERROR);<br><br>        <span class="hljs-comment">// 1.2.昵称不小于2位, 不大于10位</span><br>        <span class="hljs-keyword">if</span> (username.length() &lt; <span class="hljs-number">2</span> || username.length() &gt; <span class="hljs-number">10</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;昵称不符合要求&quot;</span>, <span class="hljs-number">50000</span>, <span class="hljs-string">&quot;昵称长度不符合要求&quot;</span>);<br><br>        <span class="hljs-comment">// 1.3.昵称不包含特殊字符</span><br>        <span class="hljs-type">String</span> <span class="hljs-variable">pattern</span> <span class="hljs-operator">=</span> <span class="hljs-string">&quot;^[\\u4e00-\\u9fa5A-Za-z\\d_]+$&quot;</span>;<br>        <span class="hljs-keyword">if</span> (!Pattern.matches(pattern, username)) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;昵称不符合要求&quot;</span>, <span class="hljs-number">50001</span>, <span class="hljs-string">&quot;昵称包含特殊字符&quot;</span>);<br><br>        <span class="hljs-comment">// 1.4.密码不小于6位, 不大于10位</span><br>        <span class="hljs-keyword">if</span> (password.length() &lt; <span class="hljs-number">6</span> || password.length() &gt; <span class="hljs-number">10</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;密码不符合要求&quot;</span>, <span class="hljs-number">60000</span>, <span class="hljs-string">&quot;密码长度不符合要求&quot;</span>);<br><br>        <span class="hljs-comment">// 1.5.检验该用户是否注册</span><br>        <span class="hljs-type">User</span> <span class="hljs-variable">user</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">User</span>();<br><br>        user.setUsername(username);<br>        <span class="hljs-type">String</span> <span class="hljs-variable">encryptPassword</span> <span class="hljs-operator">=</span> DigestUtils.md5DigestAsHex((SALT + password).getBytes());<br>        user.setPassword(encryptPassword);<br><br>        QueryWrapper&lt;User&gt; qw = <span class="hljs-keyword">new</span> <span class="hljs-title class_">QueryWrapper</span>&lt;&gt;();<br>        qw.eq(<span class="hljs-string">&quot;username&quot;</span>, username);<br>        <span class="hljs-type">User</span> <span class="hljs-variable">one</span> <span class="hljs-operator">=</span> <span class="hljs-built_in">this</span>.getOne(qw);<br><br>        <span class="hljs-comment">// 1.5.1.用户未注册(包含了MP自带的逻辑删除校验)</span><br>        <span class="hljs-keyword">if</span> (one == <span class="hljs-literal">null</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(NOT_REGISTER, <span class="hljs-string">&quot;该账户未注册&quot;</span>);<br><br>        qw.eq(<span class="hljs-string">&quot;password&quot;</span>, encryptPassword);<br>        one = <span class="hljs-built_in">this</span>.getOne(qw);<br>        <span class="hljs-keyword">if</span> (one == <span class="hljs-literal">null</span>) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(<span class="hljs-string">&quot;密码不符合要求&quot;</span>, <span class="hljs-number">60000</span>, <span class="hljs-string">&quot;密码错误&quot;</span>);<br><br><br>        <span class="hljs-comment">// 2.脱敏用户信息</span><br>        <span class="hljs-type">User</span> <span class="hljs-variable">safetyUser</span> <span class="hljs-operator">=</span> getSafetyUser(one);<br>        <span class="hljs-comment">// 3.记录用户登录态</span><br><span class="hljs-comment">//        request.getSession().setAttribute(USER_LOGIN_STATE, safetyUser);</span><br>        request.getSession().setAttribute(USER_LOGIN_STATE, safetyUser);<br>        <span class="hljs-comment">// 4.返回用户信息</span><br>        <span class="hljs-keyword">return</span> safetyUser;<br>    &#125;<br><br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@param</span> session_key token</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@return</span> 当前登陆用户信息</span><br><span class="hljs-comment"> */</span><br><span class="hljs-meta">@Override</span><br><span class="hljs-keyword">public</span> User <span class="hljs-title function_">getCurrentUser</span><span class="hljs-params">(String session_key)</span> &#123;<br>    <span class="hljs-type">String</span> <span class="hljs-variable">redisKey</span> <span class="hljs-operator">=</span> String.format(<span class="hljs-string">&quot;pic_memories:user:login:%s&quot;</span>, session_key);<br>    <span class="hljs-type">User</span> <span class="hljs-variable">currentUser</span> <span class="hljs-operator">=</span> (User) redisTemplate.opsForValue().get(redisKey);<br><br>    <span class="hljs-keyword">if</span> (currentUser == <span class="hljs-literal">null</span>) &#123;<br>        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(NO_AUTH, <span class="hljs-string">&quot;未识别到登录用户信息&quot;</span>);<br>    &#125;<br><br>    <span class="hljs-comment">// 查询数据库, 获取最新信息, 而非登录时记录的信息</span><br>    <span class="hljs-type">Long</span> <span class="hljs-variable">userId</span> <span class="hljs-operator">=</span> currentUser.getUserId();<br>    <span class="hljs-keyword">return</span> getById(userId);<br>&#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> user        修改信息</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> session_key 登录用户</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@return</span> 修改信息成功</span><br><span class="hljs-comment">    */</span><br>   <span class="hljs-meta">@Override</span><br>   <span class="hljs-keyword">public</span> String <span class="hljs-title function_">userUpdate</span><span class="hljs-params">(User user, String session_key)</span> &#123;<br>       <span class="hljs-comment">// 1.当前登录用户</span><br>       <span class="hljs-type">User</span> <span class="hljs-variable">currentUser</span> <span class="hljs-operator">=</span> <span class="hljs-built_in">this</span>.getCurrentUser(session_key);<br><br>       <span class="hljs-comment">// 2.是否一致</span><br>       <span class="hljs-keyword">if</span> (!user.getUserId().equals(currentUser.getUserId())) &#123;<br>           <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(NO_AUTH, <span class="hljs-string">&quot;无权限&quot;</span>);<br>       &#125;<br><br>       <span class="hljs-comment">// 3.执行修改</span><br>       userMapper.updateById(user);<br>       <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;修改信息成功&quot;</span>;<br>   &#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment">   * 用户注销</span><br><span class="hljs-comment">   *</span><br><span class="hljs-comment">   * <span class="hljs-doctag">@param</span> session_key session_key</span><br><span class="hljs-comment">   * <span class="hljs-doctag">@return</span> 注销成功与否(t / f)</span><br><span class="hljs-comment">   */</span><br>  <span class="hljs-meta">@Override</span><br>  <span class="hljs-keyword">public</span> String <span class="hljs-title function_">userLogout</span><span class="hljs-params">(String session_key)</span> &#123;<br>      <span class="hljs-comment">// 1.当前登录用户</span><br>      <span class="hljs-type">User</span> <span class="hljs-variable">currentUser</span> <span class="hljs-operator">=</span> <span class="hljs-built_in">this</span>.getCurrentUser(session_key);<br><br>      <span class="hljs-comment">// 2.是否存在</span><br>      <span class="hljs-keyword">if</span> (currentUser == <span class="hljs-literal">null</span>) &#123;<br>          <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BusinessException</span>(NO_AUTH, <span class="hljs-string">&quot;无权限&quot;</span>);<br>      &#125;<br><br>      <span class="hljs-comment">// 3.移除session_key</span><br>      <span class="hljs-type">String</span> <span class="hljs-variable">redisKey</span> <span class="hljs-operator">=</span> String.format(<span class="hljs-string">&quot;pic_memories:user:login:%s&quot;</span>, session_key);<br>      redisTemplate.delete(redisKey);<br><br>      <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;退出登录成功&quot;</span>;<br>  &#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-comment">&lt;!-- 点赞量 --&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">view</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;like&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">van-icon</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;&#123;&#123;isLiked ? &#x27;like&#x27; : &#x27;like-o&#x27;&#125;&#125;&quot;</span> <span class="hljs-attr">color</span>=<span class="hljs-string">&quot;red&quot;</span> <span class="hljs-attr">bindtap</span>=<span class="hljs-string">&quot;handleIconClick&quot;</span>/&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">view</span>&gt;</span><br></code></pre></td></tr></table></figure>

<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-comment">// 点赞壁纸</span><br> <span class="hljs-title function_">handleIconClick</span>(<span class="hljs-params"></span>) &#123;<br>   <span class="hljs-variable language_">this</span>.<span class="hljs-title function_">setData</span>(&#123;<br>     <span class="hljs-attr">isLiked</span>: !<span class="hljs-variable language_">this</span>.<span class="hljs-property">data</span>.<span class="hljs-property">isLiked</span>, <span class="hljs-comment">// 点击后取反</span><br>   &#125;);<br>   <span class="hljs-keyword">if</span>(<span class="hljs-variable language_">this</span>.<span class="hljs-property">data</span>.<span class="hljs-property">isLiked</span>)&#123;<br>     <span class="hljs-title class_">Toast</span>(<span class="hljs-string">&quot;已收藏~&quot;</span>)<br>   &#125;<span class="hljs-keyword">else</span>&#123;<br>     <span class="hljs-title class_">Toast</span>(<span class="hljs-string">&#x27;取消收藏~&#x27;</span>)<br>   &#125;<br> &#125;,<br></code></pre></td></tr></table></figure>



<h2 id="TODO"><a href="#TODO" class="headerlink" title="TODO"></a>TODO</h2><ul>
<li>手机号不能重复</li>
<li>注册成功后，跳转登录页，显示注册成功</li>
<li>跨域问题 ✔</li>
<li>后端的token校验 Redis ✔</li>
<li>壁纸样式可以分为手机壁纸 / 电脑壁纸</li>
<li>用户登录页面优化<ul>
<li>未登录，显示登录按钮  ✔</li>
<li>已登录，显示用户信息  ✔</li>
</ul>
</li>
<li>用户添加签名</li>
<li>修改信息未完成</li>
<li>每张壁纸应该可以同属不同的分类</li>
<li>点击壁纸，获取到的壁纸信息应该同步获取上传人信息 ✔</li>
<li><h5 id="如何使用-navagateTo-携带参数"><a href="#如何使用-navagateTo-携带参数" class="headerlink" title="如何使用 navagateTo()携带参数"></a>如何使用 navagateTo()携带参数</h5></li>
<li><h5 id="如何实现移动端-PC端下载图片"><a href="#如何实现移动端-PC端下载图片" class="headerlink" title="如何实现移动端/PC端下载图片"></a>如何实现移动端/PC端下载图片</h5></li>
<li>壁纸信息添加标签 ✔</li>
<li>点赞壁纸后端数据记录</li>
<li>修改用户信息，仍未解决，携带参数扔为修改前的数据</li>
</ul>
<h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1>
                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E9%A1%B9%E7%9B%AE/" class="category-chain-item">项目</a>
  
  
    <span>></span>
    
  <a href="/categories/%E9%A1%B9%E7%9B%AE/%E5%BC%80%E5%8F%91%E7%BB%8F%E9%AA%8C/" class="category-chain-item">开发经验</a>
  
  

  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/%E9%A1%B9%E7%9B%AE/">#项目</a>
      
        <a href="/tags/%E5%BC%80%E5%8F%91%E7%BB%8F%E9%AA%8C/">#开发经验</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>PicMemories-开发文档</div>
      <div>http://example.com/2023/08/02/PicMemories 壁纸分享小程序 - 开发文档/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Memory</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年8月2日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2023年9月8日</div>
        </div>
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2023/08/05/%E7%90%B4%E7%91%9F%E5%92%8C%E9%B8%A3%EF%BC%9A%E5%AE%9A%E5%88%B6%E5%8C%96%20Spring%20Boot%20Starter%EF%BC%8C%E8%AE%A9%E4%BD%A0%E7%9A%84%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E5%A6%82%E8%A1%8C%E4%BA%91%E6%B5%81%E6%B0%B4%E8%88%AC%E8%87%AA%E7%84%B6/" title="琴瑟和鸣：定制化 Spring Boot Starter，让你的接口调用如行云流水般自然">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">琴瑟和鸣：定制化 Spring Boot Starter，让你的接口调用如行云流水般自然</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2023/07/30/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB%EF%BC%9A%E8%B8%A9%E5%9D%91%E6%8C%87%E5%8D%97%E4%B8%8E%E6%8A%80%E5%B7%A7%E6%80%BB%E7%BB%93/" title="小程序开发经验分享：踩坑指南与技巧总结">
                        <span class="hidden-mobile">小程序开发经验分享：踩坑指南与技巧总结</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments">
      

    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.fluid-dev.com/docs/guide/" target="_blank" rel="nofollow noopener"> <span>Memory | 个人文档站点</span> </a>
<i class="iconfont icon-love"></i> <a href="https://hexo.fluid-dev.com/docs/guide/" target="_blank" rel="nofollow noopener"> <span>配置指南 | Hexo Fluid 用户手册</span> </a>   
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="leancloud-site-pv-container" style="display: none">
        总访问量 
        <span id="leancloud-site-pv"></span>
         次
      </span>
    
    
      <span id="leancloud-site-uv-container" style="display: none">
        总访客数 
        <span id="leancloud-site-uv"></span>
         人
      </span>
    
    

  
</div>

  
  
    <!-- 备案信息 ICP for China -->
    <div class="beian">
  <span>
    <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
      京ICP证123456号
    </a>
  </span>
  
    
      <span>
        <a
          href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678"
          rel="nofollow noopener"
          class="beian-police"
          target="_blank"
        >
          
            <span style="visibility: hidden; width: 0">|</span>
            <img src="/img/police_beian.png" alt="police-icon"/>
          
          <span>京公网安备12345678号</span>
        </a>
      </span>
    
  
</div>

  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>







  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>

  <script defer src="/js/leancloud.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
